<template>
	<el-select :multiple="props.isMultiple" style="width: 100%" >
		<template v-if="props.idValue">
			<el-option v-for="item in options" :key="item.Id" :label="item.Name" :value="item.Id" />
		</template>
		<el-option v-for="item in options" :key="item.Id" :label="item.Name" :value="item.Name" v-else />
	</el-select>
</template>
<script setup lang="ts">
import { Ref, ref, onMounted } from 'vue';
import { Post } from '/@/common/http';
interface DicProp {
	typeName: string;
	idValue: boolean;
	isMultiple:boolean;
}
const props = defineProps<DicProp>();
const options: Ref<any> = ref([]);
onMounted(() => {
	Post('SysDict/GetDataList', { TypeName: props.typeName }, (res: any) => {
		options.value = res.Data;
	});
});
</script>
